import {BaseModel} from "../BaseModel";

export class RecUserTime extends BaseModel{

    constructor(){
        super();
        this.symbolName = "RecUserTime";
        this.tableName = "t_rec_user_time";
        this.id = '';
        this.userId = '';//主键id
        this.timeDay = '';//天的唯一标识，比如：2020-01-01
        this.minuteCount = -1;//每一天学习的分钟数
        this.gmtCreate = '';//创建时间
    }

    dbMapper(){
        return {
            id: 'id',
            userId: 'user_id',
            timeDay: 'time_day',
            minuteCount: 'minute_count',
            gmtCreate: 'gmt_create'
        }
    }

    /**
     * 输出转换
     * @param obj
     * @returns {Book}
     */
    mappingModel(obj){
        let recUserTime = new RecUserTime();
        recUserTime.id = obj.id ? obj.id : ''
        recUserTime.userId = obj.user_id ? obj.user_id : ''
        recUserTime.timeDay = obj.time_day ? obj.time_day : ''
        recUserTime.minuteCount = obj.minute_count ? obj.minute_count : -1
        recUserTime.gmtCreate = obj.gmt_create ? obj.gmt_create : ''
        return recUserTime;
    }

}
